<?php
function get_message($offset, $limit)
{
	global $bdd;

	$offset =(int) $offset;
	$limit = (int) $limit;
	$reponse = $bdd->prepare('SELECT * FROM forum ORDER BY id DESC LIMIT :offset, :limit');
	$reponse->bindParam(':offset',$offset, PDO::PARAM_INT);
	$reponse->bindParam(':limit', $limit, PDO::PARAM_INT);
	$reponse->execute();

	$message = $reponse->fetchAll();

	return $message;
}
?>


